The expression $\cos x + \cos 3x + \cos 7x + \cos 9x$ can be written in the equivalent form
\[a \cos bx \cos cx \cos dx\]for some positive integers $a,$ $b,$ $c,$ and $d.$  Find $a + b + c + d.$
Explanation: By sum-to-product,
\[\cos x + \cos 9x = 2 \cos 5x \cos 4x\]and
\[\cos 3x + \cos 7x = 2 \cos 5x \cos 2x.\]Then
\begin{align*}
\cos x + \cos 3x + \cos 7x + \cos 9x &= 2 \cos 5x \cos 4x + 2 \cos 5x \cos 2x \\
&= 2 \cos 5x (\cos 2x + \cos 4x).
\end{align*}Again by sum-to-product,
\[2 \cos 5x (\cos 2x + \cos 4x) = 4 \cos 5x \cos 3x \cos x,\]so $a + b + c + d = 4 + 1 + 3 + 5 = \boxed{13}.$